<?php

namespace app\common\business;

use app\model\UserModel;

class User
{
    public $userObj = null;

    public function __construct()
    {
        $this->userObj = new UserModel();
    }

    public function getUserById($id)
    {
        $user = $this->userObj->getUserById($id);
        return $user;
    }

    public function getUserCount()
    {
        return $this->userObj->getCount();
    }

    public function getUserLists($id)
    {
        $sql = "select * from {$this->table} where id={$id} limit 1";
        $ret = $this->pdo->query($sql);
        $ret->setFetchMode(\PDO::FETCH_ASSOC);
        return $ret->fetch();
    }
}